import request from '@/utils/request'

// 创建巡检项目
export function createPollingProject(data) {
  return request({
    url: '/abu/polling-project/create',
    method: 'post',
    data: data
  })
}

// 更新巡检项目
export function updatePollingProject(data) {
  return request({
    url: '/abu/polling-project/update',
    method: 'put',
    data: data
  })
}

// 删除巡检项目
export function deletePollingProject(id) {
  return request({
    url: '/abu/polling-project/delete?id=' + id,
    method: 'delete'
  })
}

// 获得巡检项目
export function getPollingProject(id) {
  return request({
    url: '/abu/polling-project/get?id=' + id,
    method: 'get'
  })
}

// 获得巡检项目分页
export function getPollingProjectPage(query) {
  return request({
    url: '/abu/polling-project/page',
    method: 'get',
    params: query
  })
}


export function getPollingProjectList(query) {
  return request({
    url: '/abu/polling-project/myList',
    method: 'get',
    params: query
  })
}

export function getPollingProjectBzList(query) {
  return request({
    url: '/abu/polling-project/myListBz',
    method: 'get',
    params: query
  })
}




// 导出巡检项目 Excel
export function exportPollingProjectExcel(query) {
  return request({
    url: '/abu/polling-project/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 上传
export function uploadImage(data) {
  return request({
    url: '/abu/polling-project/img',
    method: 'put',
    data: data
  })
}
